Even with the few commands we have seen so far, we can create some useful
ARexx scripts, here is a simple example:
/*
$VER: DOS-DOpus.dopus5 1.0 (28.7.98)
Loads current shell directory into a new DOpus5 lister.
*/
options results /* Enable results */
if ~show('P','DOPUS.1') then do /* Check for DOPUS.1 ARexx port */
Say "DirectoryOpus is not running." /* Warn user if DOpus not running */
Exit 5 /* Exit with result code = 5 (Warn) */
end /* End this loop */
Address 'DOPUS.1' /* Address DOpus */
dopus front /* Bring DOpus to the front */
dir = pragma('d') /* Returns current shell in 'dir' */
lister new dir /* Open a new lister, path 'dir' */
exit /* Exit */
Pressing this button will put this script into the DOpus5:ARexx/ directory,
then from an AmigaDOS shell type:
rx DOpus5:ARexx/DOS-DOpus.dopus5
What will happen is the script will bring Opus to the front of your
display, then open a new lister with the shell's path, the script will then
end. You can then select files in that directory to perform operations
on without having had to open a new lister and work your way through the
directory structure.
We don't need to store the lister's handle for such a simple script,
because we don't perform any further operations on that lister.
Hint: Rather than having to type in 'rx DOpus5:ARexx/DOS-DOpus.dopus5'
every time you want to use the script, edit your S:Shell-Startup file and
insert something similar to the following line:
Alias DD "rx DOpus5:ARexx/DOS-DOpus.dopus5"
Now when you type 'DD' in a shell it will call the above script.
|